{$CLEO .cs}
0000:

0390: load_txd_dictionary 'LD_DUAL'
038F: load_texture "white" as 10 


while true
wait 0
0AD2: 28@ = player $PLAYER_CHAR targeted_actor //IF and SET
if 056D:   actor 28@ defined 
then
04C4: store_coords_to 0@ 1@ 2@ from_actor $PLAYER_ACTOR with_offset 0.0 1.0 0.5
04C4: store_coords_to 0@ 1@ 2@ from_actor 28@ with_offset 0.0 1.0 0.5        

0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 0@ Y 1@ Z 2@ store_screen_X_to 3@ Y_to 4@
0AB1: @DRAW_OUTLINED_BOX 9 POS 3@ 4@ SIZE 50.0 100.0 RGBA 255 0 0 255 THICKNESS 0.5
0AB1: @DRAW_LINE 9 POS 3@ 4@  _TO_ 200.0 400.0 RGBA 255 0 0 255 THICKNESS 1.0


04C4: store_coords_to 0@ 1@ 2@ from_actor 28@ with_offset 0.0 1.0 0.5   
0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 0@ Y 1@ Z 2@ store_screen_X_to 3@ Y_to 4@
0AB1: @DRAW_LINE 9 POS 3@ 4@  _TO_ 200.0 400.0 RGBA 255 0 0 255 THICKNESS 1.0
//0AB1: @DRAW_LINE 9 POS 3@ 4@ _TO_ 3@ 4@ RGBA 255 0 0 255 THICKNESS 1.0         
end
end

//
:DRAW_OUTLINED_BOX
0087: 14@  = 8@ // (float)
0087: 12@ = 2@ // (float)
0087: 13@ = 3@ // (float)
12@ /= 2.0 // (float)
13@ /= 2.0 // (float)
0087: 8@  = 0@ // (float)
005B: 8@ += 2@  // (float)
0063: 8@ -= 12@  // (float) 
0087: 9@  = 0@ // (float) 
0063: 9@ -= 2@  // (float)
005B: 9@ += 12@  // (float) 
0087: 10@ = 1@ // (float)
005B: 10@ += 3@  // (float) 
0063: 10@ -= 13@  // (float) 
0087: 11@ = 1@ // (float)     by OpcodeXe
0063: 11@ -= 3@  // (float)
005B: 11@ += 13@  // (float)   
03F0: enable_text_draw 1                                    
038E: draw_box_position  8@ 1@  size 14@ 3@ RGBA 4@ 5@ 6@ 7@ //  links
038E: draw_box_position  9@ 1@  size 14@ 3@ RGBA 4@ 5@ 6@ 7@  // rechts
038E: draw_box_position  0@ 10@  size 2@ 14@ RGBA 4@ 5@ 6@ 7@  // oben 
038E: draw_box_position  0@ 11@  size 2@ 14@ RGBA 4@ 5@ 6@ 7@  // unten 
0AB2: 0


//
:DRAW_LINE
0087: 11@ = 2@ // (float)
0087: 12@ = 3@ // (float)
0509: 10@ = distance_between_XY 0@ 1@ and_XY 2@ 3@
10@ -= 37.0 {REMOVE STRANGE OFFSET AT END}
0063: 2@ -= 0@ // (float) 
0063: 3@ -= 1@ // (float) 
0604: get_Z_angle_for_point 2@ 3@  store_to 9@
9@ += 84.0
005B: 0@ += 11@
0@ /= 2.0    {MITTE} // get center pos
005B: 1@ += 12@
1@ /= 2.0
03F0: enable_text_draw 1
074B: draw_texture 10 position 0@ 1@ scale 10@ 8@ angle 9@ color 4@ 5@ 6@ 7@
0AB2: 0

//
:getScreenXYFrom3DCoords
0AC7: 14@ = var 0@ offset
0AC7: 15@ = var 3@ offset
0AC7: 16@ = var 6@ offset
0AC7: 17@ = var 9@ offset
0AA5: call 0x70CE30 num_params 6 pop 6  0 0 17@ 16@ 15@ 14@
0007: 12@ = 640.0
0007: 13@ = 448.0
0A8D: 14@ = read_memory 0xC17044 size 4 virtual_protect 0
0A8D: 15@ = read_memory 0xC17048 size 4 virtual_protect 0
0093: 14@ = integer 14@ to_float
0093: 15@ = integer 15@ to_float
0073: 12@ /= 14@
0073: 13@ /= 15@
006B: 3@ *= 12@
006B: 4@ *= 13@
0AB2: ret 2 3@ 4@







{

while true
wait 0
    0AB1: @GET_TARGET_CAR 0 _STORE_TO 0@
    
end
    
:GET_TARGET_CAR
8@ = 0 
Actor.StorePos($PLAYER_ACTOR, 17@, 18@, 19@)         
if
0AE2: 0@ = random_vehicle_near_point 17@ 18@ 19@ in_radius 100.0 find_next 1 pass_wrecked 0
then
    REPEAT
        if
        00DF:   actor $PLAYER_ACTOR driving
        then
            03C0: 7@ = actor $PLAYER_ACTOR car
            else
            7@ = -1
        end
        0407: store_coords_to 1@ 2@ 3@ from_car 0@ with_offset 0.0 0.0 0.0
        0AB1: @getScreenXYFrom3DCoords 3 3D_coords_X 1@ 2@ 3@ _to X 4@ Y 5@
        03F0: enable_text_draw 1
        038E: draw_box_position 4@ 5@ size 50.0 50.0 RGBA 240 0 0 100 
        0509: 6@ = distance_between_XY 320.0 200.0 and_XY 4@ 5@
        if  and
        803B: 0@ == 7@ NOT_MY_CAR
        02CA: 0@ IN_VIEW
        6@ < 50.0 
        then
            8@ = 1 
            break
        end
        Actor.StorePos($PLAYER_ACTOR, 17@, 18@, 19@)         
    UNTIL 8AE2: 0@ = random_vehicle_near_point 17@ 18@ 19@ in_radius 99999.0 find_next 1 pass_wrecked 0
end
if
8@ == 0
then
    059A:  return_false
else 
    0485:  return_true
end
0AB2: 1 0@

//0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 0@ Y 1@ Z 2@ store_screen_X_to 3@ Y_to 4@
:getScreenXYFrom3DCoords
0AC7: 14@ = var 0@ offset
0AC7: 15@ = var 3@ offset
0AC7: 16@ = var 6@ offset
0AC7: 17@ = var 9@ offset
0AA5: call 0x70CE30 num_params 6 pop 6  0 0 17@ 16@ 15@ 14@
0007: 12@ = 640.0
0007: 13@ = 448.0
0A8D: 14@ = read_memory 0xC17044 size 4 virtual_protect 0
0A8D: 15@ = read_memory 0xC17048 size 4 virtual_protect 0
0093: 14@ = integer 14@ to_float
0093: 15@ = integer 15@ to_float
0073: 12@ /= 14@
0073: 13@ /= 15@
006B: 3@ *= 12@
006B: 4@ *= 13@
0AB2: ret 2 3@ 4@
{   







WHILE TRUE
0001: WAIT FALSE
1@ = 200   //a
2@ = 0     //b
3@ = 0     //g
4@ = 150   //r
0ab1:  @r_g_b_a_to_hex 4 R 1@ G 2@ B 3@ A 4@ to_color 5@
0A8C: write_memory 0xBAB22C size 4 value 5@ virtual_protect 0
1@ = 200   //a
2@ = 150     //b
3@ = 0     //g
4@ = 150   //r
0ab1:  @r_g_b_a_to_hex 4 R 1@ G 2@ B 3@ A 4@ to_color 5@
0A8C: write_memory 0xBAB230 size 4 value 5@ virtual_protect 0
    
END



:r_g_b_a_to_hex
//
0B16: 5@ = 0@ 24
0B10: 0@ = 5@ 0xFF000000
0B16: 6@ = 1@ 16
0B10: 1@ = 6@ 0x00FF0000
0B16: 7@ = 2@ 8
0B10: 2@ = 7@ 0x0000FF00
0B10: 8@ = 3@ 0x000000FF
005A: 5@ += 6@
005A: 5@ += 7@
005a: 5@ += 8@
0AB2: ret 1 5@

































{



if 0AAB: file_exists "models\txd\LINE.txd"
then                                                                                        
    0AC8: 30@ = allocate_memory_size 260                                                    
    //restore swith textures if use vt ot at or ct textures                                                                                                                                                                                                            
    //0391: release_textures                                                                                                                                                                                                                          
    0390: load_txd_dictionary 'LINE'                                                                                                                                                                                                             
    038F: load_texture "LINE" as 10 // Load dictionary with 0390 first                                                                                                                                                                              
    0AC9: free_allocated_memory 30@                                                         
else end_thread
end                                                                                         



WHILE TRUE
    WAIT 0
    

    Actor.StorePos($PLAYER_ACTOR, 17@, 18@, 19@)                                                                                   
    if 0AE1: 24@ = random_actor_near_point 17@ 18@ 19@ in_radius 1000.0 find_next 1 pass_deads 0 //IF and SET              
    jf continue                                                                                                                  
    if not 24@ == -1                                                                                                   
    jf continue
    089F: get_actor 24@ pedtyp_to 22@ 
                                                                                                              
    if not 22@ == 8 //vehicle gunner                                                                             
    jf continue 
    04C4: store_coords_to 1@ 2@ 3@ from_actor 21@ with_offset 0.0 1.0 0.5         
    Car.PutAt(22@, 1@, 52.6333, 40.0)

    10@ = 0.0
    repeat
        wait 0                                                                                            
        0ab4: 21@ < 569 //get_handler                                                                                                     
        if AND                                                                                            
            056D:   actor 24@ defined                                                                     
            056D:   actor 21@ defined                                                                     
        jf break                                                                                          
        IF AND                                                                                            
            NOT ACTOR.Dead(24@)                                                                           
            NOT ACTOR.Dead(21@)                                                                           
        jf break
        04C4: store_coords_to 1@ 2@ 3@ from_actor 21@ with_offset 0.0 1.0 0.5                                                                       
        Actor.StorePos(24@, 7@, 8@, 9@)                                                   
        0AB1: call_scm_func @NONAME_3E1 3 7@ 8@ 9@ 7@ 8@                                  
        0AB1: call_scm_func @NONAME_3E1 3 1@ 2@ 3@ 1@ 2@                                  
        0AB1: call_scm_func @NONAME_171 9 1@ 2@ 7@ 8@ 0 255 255 90.0                    
        0ACD: "DARGED AIM" 100                                 
        06BC: create_M4_shoot_from 1@ 2@ 3@ target 7@ 8@ 9@ energy 100                              
        024F: create_corona_with_radius 3.0 type 2 lensflares 0 with_color 0 255 255 at 1@ 2@ 3@       
        024F: create_corona_with_radius 2.0 type 2 lensflares 0 with_color 0 255 255 at 7@ 8@ 9@       
        0948: create_explosion_at 7@ 8@ 9@ type 1 camera_shake 0.0                                     
        083C: set_actor 24@ velocity_in_direction_XYZ 0.0 0.0 10@                                          
        10@ += 0.2
    until ACTOR.Dead(24@)
    END_THREAD                                                                                
end
Car.LockInCurrentPosition(22@) = True



:NONAME_171
0087: 11@ = 2@ // (float) 
0087: 12@ = 3@ // (float) 
0509: 10@ = distance_between_XY 0@ 1@ and_XY 2@ 3@ 
10@ -= 37.0 
0063: 2@ -= 0@ // (float) 
0063: 3@ -= 1@ // (float)
                                                          
0604: get_Z_angle_for_point 2@ 3@ store_to 9@
9@ += 90.0 
005B: 0@ += 11@ // (float) 
0@ /= 2.0 
005B: 1@ += 12@ // (float) 
1@ /= 2.0 
03F0: enable_text_draw 1
074B: draw_texture 10 position 0@ 1@ scale 10@ 8@ angle 9@ color_RGBA 4@ 5@ 6@ 7@
0AB2: ret 0

0087: 11@ = 2@ // (float) 
0087: 12@ = 3@ // (float) 
0509: 10@ = distance_between_XY 0@ 1@ and_XY 2@ 3@ 
10@ -= 37.0 
0063: 2@ -= 0@ // (float) 
0063: 3@ -= 1@ // (float) 
0604: get_Z_angle_for_point 2@ 3@ store_to 9@ 
9@ += 84.0 
005B: 0@ += 11@ // (float) 
0@ /= 2.0 
005B: 1@ += 12@ // (float) 
1@ /= 2.0 
03F0: enable_text_draw 1 
074B: draw_texture 10 position 0@ 1@ scale 10@ 8@ angle 9@ color_RGBA 4@ 5@ 6@ 7@ 
0AB2: ret 0

0087: 11@ = 2@ // (float) 
0087: 12@ = 3@ // (float) 
0509: 10@ = distance_between_XY 0@ 1@ and_XY 2@ 3@ 
10@ -= 37.0 
0063: 2@ -= 0@ // (float) 
0063: 3@ -= 1@ // (float) 
0604: get_Z_angle_for_point 2@ 3@ store_to 9@ 
9@ += 84.0 
005B: 0@ += 11@ // (float) 
0@ /= 2.0 
005B: 1@ += 12@ // (float) 
1@ /= 2.0 
03F0: enable_text_draw 1 
074B: draw_texture 10 position 0@ 1@ scale 10@ 8@ angle 9@ color_RGBA 4@ 5@ 6@ 7@ 
0AB2: ret 0

0087: 11@ = 2@ // (float) 
0087: 12@ = 3@ // (float) 
0509: 10@ = distance_between_XY 0@ 1@ and_XY 2@ 3@ 
10@ -= 37.0 
0063: 2@ -= 0@ // (float) 
0063: 3@ -= 1@ // (float) 
0604: get_Z_angle_for_point 2@ 3@ store_to 9@ 
9@ += 84.0 
005B: 0@ += 11@ // (float) 
0@ /= 2.0 
005B: 1@ += 12@ // (float) 
1@ /= 2.0 
03F0: enable_text_draw 1 
074B: draw_texture 10 position 0@ 1@ scale 10@ 8@ angle 9@ color_RGBA 4@ 5@ 6@ 7@ 
0AB2: ret 0 

:NONAME_3E1
0AC7: 14@ = var 0@ offset 
0AC7: 15@ = var 3@ offset 
0AC7: 16@ = var 6@ offset 
0AC7: 17@ = var 9@ offset 
0AA5: call 7392816 num_params 6 pop 6 0 0 17@ 16@ 15@ 14@  
12@ = 640.0 
13@ = 448.0 
0A8D: 14@ = read_memory 12677188 size 4 virtual_protect 0 
0A8D: 15@ = read_memory 12677192 size 4 virtual_protect 0 
0093: 14@ = integer 14@ to_float 
0093: 15@ = integer 15@ to_float 
0073: 12@ /= 14@ // (float) 
0073: 13@ /= 15@ // (float) 
006B: 3@ *= 12@ // (float) 
006B: 4@ *= 13@ // (float) 
0AB2: ret 2 3@ 4@

   


